package com.gzhryc.shared_device.oem.code.agent.dao.db;

import java.util.Date;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.annotaion.UniqueKey;
import com.gzhryc.shared_device.oem.code.business.EBusinessType;
import com.gzhryc.shared_device.oem.code.user.dao.db.User;

@Table(name="agent_referrer_business_config")
public class AgentReferrerBusinessConfig {

	@UniqueKey(name="user_type")
	@PrimaryKey
    @Column(name = "user_id",notNull = true,note = "用户ID")
    protected Long userId;
	
	@PrimaryKey
	@Column(name = "referrer_user_id", notNull = true,note = "介绍人ID")
    protected Long referrerUserId;
	
	@UniqueKey(name="user_type")
	@PrimaryKey
    @Column(name = "business_type", notNull = true)
    protected String businessType;
    
    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;
    
    @Join(fromField="referrer_user_id")
    protected User referrerUser;
    
    protected User user; 
    
    protected Double incomeRatio = 0D;		//动态算出，代理业务服务费 - 默认服务费

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getReferrerUserId() {
		return referrerUserId;
	}

	public void setReferrerUserId(Long referrerUserId) {
		this.referrerUserId = referrerUserId;
	}

	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public User getReferrerUser() {
		return referrerUser;
	}

	public void setReferrerUser(User referrerUser) {
		this.referrerUser = referrerUser;
	}
	
	public Double getIncomeRatio() {
		return incomeRatio;
	}

	public void setIncomeRatio(Double incomeRatio) {
		this.incomeRatio = incomeRatio;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getBusinessTypeName() {
		return EBusinessType.note(this.businessType);
	}
}
